﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebRSSBuilder.ASP
{
    public partial class ManageFiles : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.IsInRole("Admin"))
            {
                Session["ErrorNo"] = 1;
                Response.Redirect("Error.aspx"); 
            }
        }

       protected void Button1_Click(object sender, EventArgs e)
        {
            this.DetailsView1.Visible = true;
            this.PopupPanel.Visible = true; 
            this.Button2_ModalPopupExtender.Show();
            ((TextBox)this.DetailsView1.Rows[0].Cells[1].Controls[1]).Text = "";
           ((TextBox)this.DetailsView1.Rows[1].Cells[1].Controls[1]).Text = "";
            this.UpdatePanel1.Update();
        }

     

        protected void BtnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
             {
                this.DetailsView1.InsertItem(false);
                this.PopupPanel.Visible = false;
                this.Button2_ModalPopupExtender.Hide();
                this.GridView1.DataBind();
                this.UpdatePanel1.Update(); 
            }
        }
    }
}